#ifndef MAINMENU_H
#define MAINMENU_H

#include "Personal.h"

#include <QGridLayout>
#include <QWidget>
#include <QPushButton>
#include <QToolButton>
#include <Registration.h>
namespace Ui {
class MainMenu;
}

class MainMenu : public QWidget
{
    Q_OBJECT

public:
    explicit MainMenu(QRect screenGeometry,QString phone,QString pass,QWidget *parent = nullptr);
    ~MainMenu();
    void creatRegistration(QString data);
    void creatPersonal(QString phone,QString id,QString name,
                       QString nation,QString sex,QString blood,
                       QString birth,QString illness,QString irritability);
    static QString phone;
    static QString pass;
protected:
    void init();
private:
    Ui::MainMenu *ui;
    QGridLayout *pLayout=nullptr;
    QRect screenGeometry;
    QList<QPushButton *> functions;
    int rows=3;
    int column=2;
    void packMessageToServer(int function);
    Registration *registration=nullptr;
    Personal *personal=nullptr;


signals:
    void toServerSend_signals(QString message);
    void receiveServerData_signal(int function,QString data);
public slots:
    void receiveServerData_slot(int function,QMap<QString, QString> kv);
};

#endif // MAINMENU_H
